home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / loggates / loggates.mf < prev    next >
Text File  |  1992-06-14  |  16KB  |  778 lines

  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %
  3. %    Loggates.mf --- special characters for drawing digital
  4. %    electronic circuits with logical gates.
  5. %
  6. %    Version history:
  7. %    -  "milstd" font by Rick Simpson, font for logical gates
  8. %       as in MIL-STD 806.
  9. %       (published in UKTeX 1988, issue 30 (23 Sept. 1988).)
  10. %    -  Extended version, 30 March 1992, by Nico Verwer,
  11. %       now called loggates.mf. Added XOR, NXOR and OR-input
  12. %       lines, supported in loggates.sty.
  13. %
  14. %    To create the "loggates" font, use the command:
  15. %       makefont loggates
  16. %    or:  
  17. %       mf '\mode=localfont; mag=magstepX ; input' loggates.mf
  18. %    for X = 0, 0.5, 1, 2, 3, 4, 5.
  19. %
  20. %    To use the characters in a PLAIN TeX document:
  21. %       \font\loggates=loggates         % define the font
  22. %            . . .
  23. %       {\loggates\char0}               % typeset the character
  24. %
  25. %    To use the characters in a LaTeX document:
  26. %        \newfont{\loggates}{loggates}   % define the font
  27. %             . . .
  28. %        {\loggates\char0}               % typeset the character
  29. %
  30. %    The file loggates.sty contains definitions that make this 
  31. %    font easy to use.
  32. %
  33.  
  34. mode_setup;
  35. font_identifier "LOGGATES";
  36. font_size 10pt#;
  37. gatew = 1.2pt;
  38. linew = 0.4pt;
  39.  
  40. picture pic;
  41.  
  42. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  43. %
  44. %       Slanting line at 45-degree angle for marking
  45. %       busses in logic diagrams.
  46.  
  47. slwd#:=7pt#;
  48. define_pixels(slwd);
  49.  
  50. beginchar(0,slwd#,slwd#,0);  "Slanted line for buss widths";
  51.  
  52. x1 = 0;
  53. y1 = 0;
  54.  
  55. x2 = slwd;
  56. y2 = slwd;
  57.  
  58. pickup pencircle scaled gatew;
  59. draw z1--z2;
  60.  
  61. labels (1,2);
  62.  
  63. endchar;
  64.  
  65. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  66. %
  67. %       AND gate, facing to the right
  68. %
  69.  
  70. gateunit# := 6pt#;
  71.  
  72. gatea# := 2   * gateunit#;
  73. gateb# := 4   * gateunit#;
  74. gatec# := 2.5 * gateunit#;
  75. gated# := 2   * gateunit#;
  76.  
  77. define_pixels(gatea,gateb,gatec,gated);
  78.  
  79. w_and# := gatec#+gated#;
  80. h_and# := gateb#;
  81. define_pixels(w_and,h_and);
  82.  
  83. beginchar(1,w_and#,h_and#,0);  "AND gate, right";
  84.  
  85. x1 = x2 = 0;
  86. x3 = x5 = gatec;
  87. x4 = gatec + gated;
  88.  
  89. y1 = y5 = 0;
  90. y2 = y3 = gateb;
  91. y4 = gatea;
  92.  
  93. pickup pencircle scaled gatew;
  94. draw z1--z2--z3{right}..z4..{left}z5--z1;
  95.  
  96. pic := currentpicture;
  97.  
  98. labels (range 1 thru 5);
  99.  
  100. endchar;
  101.  
  102. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  103. %
  104. %       AND gate, facing down
  105. %
  106.  
  107. beginchar(2,h_and#,w_and#,0);  "AND gate, down";
  108.  
  109. currentpicture := pic rotated 270 shifted (0,w_and);
  110.  
  111. endchar;
  112.  
  113. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  114. %
  115. %       AND gate, facing to the left
  116. %
  117.  
  118. beginchar(3,w_and#,h_and#,0);  "AND gate, right";
  119.  
  120. currentpicture := pic rotated 180 shifted(w_and,h_and);
  121.  
  122. endchar;
  123.  
  124. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  125. %
  126. %       AND gate, facing up
  127. %
  128.  
  129. beginchar(4,h_and#,w_and#,0);  "AND gate, up";
  130.  
  131. currentpicture := pic rotated 90 shifted(h_and,0);
  132.  
  133. endchar;
  134.  
  135. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  136. %
  137. %       NAND gate, facing to the right
  138. %
  139.  
  140. gatee# := gateunit#;
  141.  
  142. define_pixels(gatee);
  143.  
  144. w_nand# := gatec#+gated#+gatee#;
  145. h_nand# := gateb#;
  146. define_pixels(w_nand,h_nand);
  147.  
  148. beginchar(5,w_nand#,h_nand#,0);  "NAND gate, right";
  149.  
  150. x1 = x2 = 0;
  151. x3 = x5 = gatec;
  152. x4 = gatec + gated;
  153. x6 = x4 + gatee/2;
  154.  
  155. y1 = y5 = 0;
  156. y2 = y3 = gateb;
  157. y4 = gatea;
  158. y6 = y4;
  159.  
  160. pickup pencircle scaled gatew;
  161. draw z1--z2--z3{right}..z4..{left}z5--z1;
  162. draw fullcircle scaled gatee shifted(z6);
  163.  
  164. pic := currentpicture;
  165.  
  166. labels (range 1 thru 6);
  167.  
  168. endchar;
  169.  
  170. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  171. %
  172. %       NAND gate, facing down
  173. %
  174.  
  175. beginchar(6,h_nand#,w_nand#,0);  "NAND gate, down";
  176.  
  177. currentpicture := pic rotated 270 shifted (0,w_nand);
  178.  
  179. endchar;
  180.  
  181. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  182. %
  183. %       NAND gate, facing to the left
  184. %
  185.  
  186. beginchar(7,w_nand#,h_nand#,0);  "NAND gate, left";
  187.  
  188. currentpicture := pic rotated 180 shifted(w_nand,h_nand);
  189.  
  190. endchar;
  191.  
  192. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  193. %
  194. %       NAND gate, facing up
  195. %
  196.  
  197. beginchar(8,h_nand#,w_nand#,0);  "NAND gate, up";
  198.  
  199. currentpicture := pic rotated 90 shifted(h_nand,0);
  200.  
  201. endchar;
  202.  
  203. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  204. %
  205. %       OR gate, facing to the right
  206. %
  207.  
  208. gatef# := .75 * gateunit#;
  209. gateg# := 1.5 * gateunit#;
  210. gateh# := 3   * gateunit#;
  211.  
  212. define_pixels(gatef,gateg,gateh);
  213.  
  214. w_or# := gateg#+gateh#;
  215. h_or# := gateb#;
  216. define_pixels(w_or,h_or);
  217.  
  218. beginchar(9,w_or#,h_or#,0);  "OR gate, right";
  219.  
  220. x1 = x2 = 0;
  221. x3 = x5 = gateg;
  222. x4 = gateg + gateh;
  223. x6 = gatef;
  224.  
  225. y1 = y5 = 0;
  226. y2 = y3 = gateb;
  227. y4 = y6 = gatea;
  228.  
  229. pickup pencircle scaled gatew;
  230. draw z1..z6..z2;
  231. draw z2--z3;
  232. draw z3{right}..{(1,-2)}z4;
  233. draw z4{-1,-2}..z5{left};
  234. draw z5--z1;
  235.  
  236. pic := currentpicture;
  237.  
  238. labels (range 1 thru 6);
  239.  
  240. endchar;
  241.  
  242. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  243. %
  244. %       OR gate, facing down
  245. %
  246.  
  247. beginchar(10,h_or#,w_or#,0);  "OR gate, down";
  248.  
  249. currentpicture := pic rotated 270 shifted (0,w_or);
  250.  
  251. endchar;
  252.  
  253. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  254. %
  255. %       OR gate, facing to the left
  256. %
  257.  
  258. beginchar(11,w_or#,h_or#,0);  "OR gate, left";
  259.  
  260. currentpicture := pic rotated 180 shifted(w_or,h_or);
  261.  
  262. endchar;
  263.  
  264. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  265. %
  266. %       OR gate, facing up
  267. %
  268.  
  269. beginchar(12,h_or#,w_or#,0);  "OR gate, up";
  270.  
  271. currentpicture := pic rotated 90 shifted(h_or,0);
  272.  
  273. endchar;
  274.  
  275. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  276. %
  277. %       NOR gate, facing to the right
  278. %
  279.  
  280. w_nor# := gateg#+gateh#+gatee#;
  281. h_nor# := gateb#;
  282. define_pixels(w_nor,h_nor);
  283.  
  284. beginchar(13,w_nor#,h_nor#,0);  "NOR gate, right";
  285.  
  286. x1 = x2 = 0;
  287. x3 = x5 = gateg;
  288. x4 = gateg + gateh;
  289. x6 = gatef;
  290. x7 = x4 + gatee/2;
  291.  
  292. y1 = y5 = 0;
  293. y2 = y3 = gateb;
  294. y4 = y6 = gatea;
  295. y7 = y4;
  296.  
  297. pickup pencircle scaled gatew;
  298. draw z1..z6..z2;
  299. draw z2--z3;
  300. draw z3{right}..{(1,-2)}z4;
  301. draw z4{-1,-2}..z5{left};
  302. draw z5--z1;
  303. draw fullcircle scaled gatee shifted (z7);
  304.  
  305. pic := currentpicture;
  306.  
  307. labels (range 1 thru 7);
  308.  
  309. endchar;
  310.  
  311. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  312. %
  313. %       NOR gate, facing down
  314. %
  315.  
  316. beginchar(14,h_nor#,w_nor#,0);  "NOR gate, down";
  317.  
  318. currentpicture := pic rotated 270 shifted (0,w_nor);
  319.  
  320. endchar;
  321.  
  322. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  323. %
  324. %       NOR gate, facing to the left
  325. %
  326.  
  327. beginchar(15,w_nor#,h_nor#,0);  "NOR gate, left";
  328.  
  329. currentpicture := pic rotated 180 shifted(w_nor,h_nor);
  330.  
  331. endchar;
  332.  
  333. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  334. %
  335. %       NOR gate, facing up
  336. %
  337.  
  338. beginchar(16,h_nor#,w_nor#,0);  "NOR gate, up";
  339.  
  340. currentpicture := pic rotated 90 shifted(h_nor,0);
  341.  
  342. endchar;
  343.  
  344. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  345. %
  346. %       Buffer, facing to the right
  347. %
  348.  
  349. gatei# := 3    * gateunit#;
  350. gatej# := .866 * gatei#;
  351. gatek# := 1.5  * gateunit#;
  352.  
  353. define_pixels(gatei,gatej,gatek);
  354.  
  355. w_buf# := gatej#;
  356. h_buf# := gatei#;
  357. define_pixels(w_buf,h_buf);
  358.  
  359. beginchar(17,w_buf#,h_buf#,0);  "Buffer, right";
  360.  
  361. x1 = x2 = 0;
  362. x3 = gatej;
  363.  
  364. y1 = 0;
  365. y2 = gatei;
  366. y3 = gatek;
  367.  
  368. pickup pencircle scaled gatew;
  369. draw z1--z2--z3--z1;
  370.  
  371. pic := currentpicture;
  372.  
  373. labels (range 1 thru 3);
  374.  
  375. endchar;
  376.  
  377. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  378. %
  379. %       Buffer, facing down
  380. %
  381.  
  382. beginchar(18,h_buf#,w_buf#,0);  "Buffer, down";
  383.  
  384. currentpicture := pic rotated 270 shifted (0,w_buf);
  385.  
  386. endchar;
  387.  
  388. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  389. %
  390. %       Buffer, facing to the left
  391. %
  392.  
  393. beginchar(19,w_buf#,h_buf#,0);  "Buffer, left";
  394.  
  395. currentpicture := pic rotated 180 shifted(w_buf,h_buf);
  396.  
  397. endchar;
  398.  
  399. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  400. %
  401. %       Buffer, facing up
  402. %
  403.  
  404. beginchar(20,h_buf#,w_buf#,0);  "Buffer, up";
  405.  
  406. currentpicture := pic rotated 90 shifted(h_buf,0);
  407.  
  408. endchar;
  409.  
  410. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  411. %
  412. %       Inverter, facing to the right
  413. %
  414.  
  415. w_inv# := gatej#+gatee#;
  416. h_inv# := gatei#;
  417. define_pixels(w_inv,h_inv);
  418.  
  419. beginchar(21,w_inv#,h_inv#,0);  "Inverter, right";
  420.  
  421. x1 = x2 = 0;
  422. x3 = gatej;
  423. x4 = x3 + gatee/2;
  424.  
  425. y1 = 0;
  426. y2 = gatei;
  427. y3 = y4 = gatek;
  428.  
  429.  
  430. pickup pencircle scaled gatew;
  431. draw z1--z2--z3--z1;
  432. draw fullcircle scaled gatee shifted (z4);
  433.  
  434. pic := currentpicture;
  435.  
  436. labels (range 1 thru 4);
  437.  
  438. endchar;
  439.  
  440. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  441. %
  442. %       Inverter, facing down
  443. %
  444.  
  445. beginchar(22,h_inv#,w_inv#,0);  "Inverter, down";
  446.  
  447. currentpicture := pic rotated 270 shifted (0,w_inv);
  448.  
  449. endchar;
  450.  
  451. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  452. %
  453. %       Inverter, facing to the left
  454. %
  455.  
  456. beginchar(23,w_inv#,h_inv#,0);  "Inverter, left";
  457.  
  458. currentpicture := pic rotated 180 shifted(w_inv,h_inv);
  459.  
  460. endchar;
  461.  
  462. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  463. %
  464. %       Inverter, facing up
  465. %
  466.  
  467. beginchar(24,h_inv#,w_inv#,0);  "Inverter, up";
  468.  
  469. currentpicture := pic rotated 90 shifted(h_inv,0);
  470.  
  471. endchar;
  472.  
  473. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  474. %
  475. %       XOR gate, facing to the right
  476. %
  477.  
  478. w_xor# := gatef#+gateg#+gateh#;
  479. h_xor# := gateb#;
  480. define_pixels(w_xor,h_xor);
  481.  
  482. beginchar(25,w_xor#,h_xor#,0);  "XOR gate, right";
  483.  
  484. x1 = x2 = 0 + gatef;
  485. x3 = x5 = gateg + gatef;
  486. x4 = gateg + gateh + gatef;
  487. x6 = gatef + gatef;
  488. x7 = x8 = 0;
  489. x9 = 0 + gatef;
  490.  
  491. y1 = y5 = 0;
  492. y2 = y3 = gateb;
  493. y4 = y6 = gatea;
  494. y7 = 0;
  495. y8 = gateb;
  496. y9 = gatea;
  497.  
  498. pickup pencircle scaled gatew;
  499. draw z1..z6..z2;
  500. draw z2--z3;
  501. draw z3{right}..{(1,-2)}z4;
  502. draw z4{-1,-2}..z5{left};
  503. draw z5--z1;
  504. draw z8..z9..z7;
  505.  
  506. pic := currentpicture;
  507.  
  508. labels (range 1 thru 9);
  509.  
  510. endchar;
  511.  
  512. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  513. %
  514. %       XOR gate, facing down
  515. %
  516.  
  517. beginchar(26,h_xor#,w_xor#,0);  "XOR gate, down";
  518.  
  519. currentpicture := pic rotated 270 shifted (0,w_xor);
  520.  
  521. endchar;
  522.  
  523. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  524. %
  525. %       XOR gate, facing to the left
  526. %
  527.  
  528. beginchar(27,w_xor#,h_xor#,0);  "XOR gate, left";
  529.  
  530. currentpicture := pic rotated 180 shifted(w_xor,h_xor);
  531.  
  532. endchar;
  533.  
  534. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  535. %
  536. %       XOR gate, facing up
  537. %
  538.  
  539. beginchar(28,h_xor#,w_xor#,0);  "XOR gate, up";
  540.  
  541. currentpicture := pic rotated 90 shifted(h_xor,0);
  542.  
  543. endchar;
  544.  
  545. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  546. %
  547. %       NXOR gate (a.k.a. comparator), facing to the right
  548. %
  549.  
  550. w_nxor# := gatef#+gateg#+gateh#+gatee#;
  551. h_nxor# := gateb#;
  552. define_pixels(w_nxor,h_nxor);
  553.  
  554. beginchar(29,w_nxor#,h_nxor#,0);  "NXOR gate, right";
  555.  
  556. x1 = x2 = 0 + gatef;
  557. x3 = x5 = gateg + gatef;
  558. x4 = gateg + gateh + gatef;
  559. x6 = gatef + gatef;
  560. x7 = x8 = 0;
  561. x9 = 0 + gatef;
  562. x10 = x4 + gatee/2;
  563.  
  564. y1 = y5 = 0;
  565. y2 = y3 = gateb;
  566. y4 = y6 = gatea;
  567. y7 = 0;
  568. y8 = gateb;
  569. y9 = gatea;
  570. y10 = y4;
  571.  
  572. pickup pencircle scaled gatew;
  573. draw z1..z6..z2;
  574. draw z2--z3;
  575. draw z3{right}..{(1,-2)}z4;
  576. draw z4{-1,-2}..z5{left};
  577. draw z5--z1;
  578. draw z8..z9..z7;
  579. draw fullcircle scaled gatee shifted (z10);
  580.  
  581. pic := currentpicture;
  582.  
  583. labels (range 1 thru 10);
  584.  
  585. endchar;
  586.  
  587. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  588. %
  589. %       NXOR gate, facing down
  590. %
  591.  
  592. beginchar(30,h_nxor#,w_nxor#,0);  "NXOR gate, down";
  593.  
  594. currentpicture := pic rotated 270 shifted (0,w_nxor);
  595.  
  596. endchar;
  597.  
  598. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  599. %
  600. %       NXOR gate, facing to the left
  601. %
  602.  
  603. beginchar(31,w_nxor#,h_nxor#,0);  "NXOR gate, left";
  604.  
  605. currentpicture := pic rotated 180 shifted(w_nxor,h_nxor);
  606.  
  607. endchar;
  608.  
  609. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  610. %
  611. %       NXOR gate, facing up
  612. %
  613.  
  614. beginchar(32,h_nxor#,w_nxor#,0);  "NXOR gate, up";
  615.  
  616. currentpicture := pic rotated 90 shifted(h_nxor,0);
  617.  
  618. endchar;
  619.  
  620. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  621. %
  622. %      lines to connect inputs of OR-like gates
  623. %      N.B.: right/down facing inputs come before the gate,
  624. %      left/up facing inputs after the gate!
  625. %      The left/down lines have to be shifted by TeX, since 
  626. %      this shift cannot be determined in advance for down-
  627. %      facing lines.
  628. %      Only the right-facing lines have a height, which should
  629. %      be used to determine the exact place where connections
  630. %      should enter the gate.
  631. %
  632.  
  633. linea# := 0.2 * gateb#;
  634. lineb# := 0.25 * (gateb# - (2 * linea#));
  635. linec# := 0.3333 * (gateb# - (2 * linea#));
  636.  
  637. lineea# := 0.5 * gatef#;
  638. lineeb# := 0.75 * gatef#;
  639. lineec# := 0.87 * gatef#;
  640. lineed# := 0.95 * gatef#;
  641.  
  642. define_pixels(linea,lineb,linec,lineea,lineeb,lineec,lineed);
  643.  
  644. beginchar(33,0,gateb#-linea#,0); "upper input facing right";
  645. x1 = 0;
  646. x2 = lineea;
  647. y1 = y2 = gateb - linea;
  648. pickup pencircle scaled linew;
  649. draw z1--z2;
  650. pic := currentpicture;
  651. labels (range 1 thru 2);
  652. endchar;
  653. beginchar(40,0,0,0); "upper input facing down";
  654. currentpicture := pic rotated 270;
  655. endchar;
  656. beginchar(47,0,0,0); "upper input facing left";
  657. currentpicture := pic rotated 180;
  658. endchar;
  659. beginchar(54,0,0,0); "upper input facing up";
  660. currentpicture := pic rotated 90;
  661. endchar;
  662.  
  663. beginchar(34,0,linea#,0); "lower input facing right";
  664. x1 = 0;
  665. x2 = lineea;
  666. y1 = y2 = linea;
  667. pickup pencircle scaled linew;
  668. draw z1--z2;
  669. pic := currentpicture;
  670. labels (range 1 thru 2);
  671. endchar;
  672. beginchar(41,0,0,0); "lower input facing down";
  673. currentpicture := pic rotated 270;
  674. endchar;
  675. beginchar(48,0,0,0); "lower input facing left";
  676. currentpicture := pic rotated 180;
  677. endchar;
  678. beginchar(55,0,0,0); "lower input facing up";
  679. currentpicture := pic rotated 90;
  680. endchar;
  681.  
  682. beginchar(35,0,linea#+(2*lineb#),0); "middle input facing right";
  683. x1 = 0;
  684. x2 = lineed;
  685. y1 = y2 = linea + (2 * lineb);
  686. pickup pencircle scaled linew;
  687. draw z1--z2;
  688. pic := currentpicture;
  689. labels (range 1 thru 2);
  690. endchar;
  691. beginchar(42,0,0,0); "middle input facing down";
  692. currentpicture := pic rotated 270;
  693. endchar;
  694. beginchar(49,0,0,0); "middle input facing left";
  695. currentpicture := pic rotated 180;
  696. endchar;
  697. beginchar(56,0,0,0); "middle input facing up";
  698. currentpicture := pic rotated 90;
  699. endchar;
  700.  
  701. beginchar(36,0,gateb#-linea#-lineb#,0); "upper-middle input facing right";
  702. x1 = 0;
  703. x2 = lineeb;
  704. y1 = y2 = gateb - linea - lineb;
  705. pickup pencircle scaled linew;
  706. draw z1--z2;
  707. pic := currentpicture;
  708. labels (range 1 thru 2);
  709. endchar;
  710. beginchar(43,0,0,0); "upper-middle input facing down";
  711. currentpicture := pic rotated 270;
  712. endchar;
  713. beginchar(50,0,0,0); "upper-middle input facing left";
  714. currentpicture := pic rotated 180;
  715. endchar;
  716. beginchar(57,0,0,0); "upper-middle input facing up";
  717. currentpicture := pic rotated 90;
  718. endchar;
  719.  
  720. beginchar(37,0,linea#+lineb#,0); "lower-middle input facing right";
  721. x1 = 0;
  722. x2 = lineeb;
  723. y1 = y2 = linea + lineb;
  724. pickup pencircle scaled linew;
  725. draw z1--z2;
  726. pic := currentpicture;
  727. labels (range 1 thru 2);
  728. endchar;
  729. beginchar(44,0,0,0); "lower-middle input facing down";
  730. currentpicture := pic rotated 270;
  731. endchar;
  732. beginchar(51,0,0,0); "lower-middle input facing left";
  733. currentpicture := pic rotated 180;
  734. endchar;
  735. beginchar(58,0,0,0); "lower-middle input facing up";
  736. currentpicture := pic rotated 90;
  737. endchar;
  738.  
  739. beginchar(38,0,gateb#-linea#-linec#,0); "next-to-upper input facing right";
  740. x1 = 0;
  741. x2 = lineec;
  742. y1 = y2 = gateb - linea - linec;
  743. pickup pencircle scaled linew;
  744. draw z1--z2;
  745. pic := currentpicture;
  746. labels (range 1 thru 2);
  747. endchar;
  748. beginchar(45,0,0,0); "next-to-upper input facing down";
  749. currentpicture := pic rotated 270;
  750. endchar;
  751. beginchar(52,0,0,0); "next-to-upper input facing left";
  752. currentpicture := pic rotated 180;
  753. endchar;
  754. beginchar(59,0,0,0); "next-to-upper input facing up";
  755. currentpicture := pic rotated 90;
  756. endchar;
  757.  
  758. beginchar(39,0,linea#+linec#,0); "next-to-lower input facing right";
  759. x1 = 0;
  760. x2 = lineec;
  761. y1 = y2 = linea + linec;
  762. pickup pencircle scaled linew;
  763. draw z1--z2;
  764. pic := currentpicture;
  765. labels (range 1 thru 2);
  766. endchar;
  767. beginchar(46,0,0,0); "next-to-lower input facing down";
  768. currentpicture := pic rotated 270;
  769. endchar;
  770. beginchar(53,0,0,0); "next-to-lower input facing left";
  771. currentpicture := pic rotated 180;
  772. endchar;
  773. beginchar(60,0,0,0); "next-to-lower input facing up";
  774. currentpicture := pic rotated 90;
  775. endchar;
  776.  
  777. end;
  778.